<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script type="text/javascript">
			function fun1(){
				var temp = document.createElement("div");
				temp.innerHTML = "div的文字";
				temp.setAttribute("style","color:red;")
				document.getElementById("con").appendChild(temp);
			}
			function fun2(){
				var temp = document.createElement("img");
				temp.setAttribute("src","img/off.png");
				temp.setAttribute("width","100px");
				document.getElementById("con").appendChild(temp);
			}
		</script>
	</head>
	<body>
		<button onclick="fun1()">添加文本</button>
		<button onclick="fun2()">添加图片</button>
		<div id="con"></div>
	</body>
</html>
